<%-- 
    Document   : result
    Created on : Apr 6, 2012, 3:06:17 AM
    Author     : Ajay Kumar "Mukund"
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@include file="header.jsp" %>
<%@page import="jobportal.Dbconn"%>
<%@page import="java.sql.*" %>
<%
    Connection con = null;
    Statement st = null;
    String username = (String) session.getAttribute("username");


    try {
        con = Dbconn.getConn();
        st = con.createStatement();
        ResultSet rs;

        String sql = "select company.compid,compname,jobtitle,venue,walkindate,result,jobs.jobid"
                + " from company,jobs,job_applied "
                + " where job_applied.jobid=jobs.jobid and "
                + " jobs.compid=company.compid and "
                + " job_applied.username='" + username + "' and "
                + " result is not null";

        rs = st.executeQuery(sql);


%>
<table width="100%" cellpadding="0" cellspacing="0" class="tbl_bdr">

    <tr class="sde_mnu_hdr_blue" style="background-color: lightskyblue;text-align: center">
        <td width="3%" align="center" valign="middle"><strong># </strong></td>
        <td height="29" colspan="2" align="center" valign="middle"><strong>Company</strong></td>
        <td width="21%" align="center" valign="middle"><strong>Job Title </strong></td>
        <td width="18%" align="center" valign="middle"> <strong>Exam Center </strong> </td>
        <td width="15%" align="center" valign="middle"><strong>Date </strong></td>
        <td width="19%" align="center" valign="middle"><strong>Status</strong></td>
    </tr>
    <tr>
        <td height="10" colspan="7" align="left" valign="middle" ></td>
    </tr>
    <%
        int i = 0;
        while (rs.next()) {
            i++;
    %>

    <tr>
        <td width="3%" height="70" align="left" valign="middle" ><%=i%></td>
        <td width="8%" align="left" valign="middle"  style="padding-left:5px;"><img src="../src/getpic.jsp?id=<%=rs.getString("compid")%>&table=company&col=logo&pk_col=compid" alt="complogo" width="113" height="48"></td>
        <td width="16%" align="center" valign="middle"  style="padding-left:5px; text-transform:capitalize;">
            <span style="padding-left:5px;"><a href="viewjobdetails.jsp?jobid=<%=rs.getString("jobid")%>">
                    <%=rs.getString(2)%>
                </a>
            </span>
        </td>
        <td align="center" valign="middle"  style="padding-left:5px; text-transform:capitalize;">
            <a href="viewjobdetails.jsp?jobid=<%=rs.getString("jobid")%>">
                <%=rs.getString(3)%>
            </a>
        </td>
        <td align="center" valign="middle"  style="padding-left:5px;"><%=rs.getString(4)%></td>
        <td align="center" valign="middle"  style="padding-left:5px;"><%=rs.getString(5)%></td>
        <td align="center" valign="middle"  style="padding-left:5px;"><%=rs.getString(6)%></td>
    </tr>
    <%
        }%>

    <tr class="sde_mnu_hdr_blue">
        <td height="28" colspan="7" align="left" valign="middle" style="background-color: lightskyblue;text-align: center" ><%
              rs.last();
              out.println("<strong>" + rs.getRow() + " result found</strong>");

          } catch (Exception e) {
              out.println(e);
          } finally {
              st.close();
              con.close();
          }
            %></td>
    </tr>
</table>

<%@include file="footer.jsp" %>